from selenium import webdriver
from selenium.webdriver.common.by import By
import time

# 启动驱动
driver=webdriver.Edge()
# 访问网址
driver.get('https://www.baidu.com/')
# 强制等待
time.sleep(2)

# 点击相机按钮
driver.find_element(By.XPATH,'/html/body/div[1]/div[1]/div[6]/div/div/form/span[1]/span[1]').click()
time.sleep(2)
# 点击上传按钮
driver.find_element(By.XPATH,'/html/body/div[1]/div[1]/div[6]/div/div/form/div/div[2]/div[2]/input').send_keys(r'C:\Users\15085\Desktop\屏幕截图 2025-07-23 111448.png')
time.sleep(2)









